﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProjectBase.Core.PersistenceSupport;
using ProjectBase.Core;

namespace SLSYJ.Core
{
    public class Month : PersistentObject,IMonth
    {
        protected Month() { }

        public Month(string name, int number)
        {
            Check.Require(!String.IsNullOrEmpty(name), "name may not be null or empty");
            Check.Require(!(number < 0), "number may not be less than 0");
            Check.Require(!(number == 0), "number may not be equals to 0");
            Name = name;
            Number = number;
        }

        [DomainSignature]
        public virtual string Name { get; set; }

        [DomainSignature]
        public virtual int Number { get; set; }

        public virtual int CountOfDays { get; set; }

        public virtual int WorkedDays { get; set; }

        public virtual int AwaySickDays { get; set; }

        public virtual int AwayAccidentDays { get; set; }

        protected override string GetDomainObjectSignature()
        {
            return Name + "|" + Number.ToString();
        }

        public virtual int GetTotalAmountOfDays()
        {
            throw new System.NotImplementedException();
        }
    }
}
